/// @tags: Binom Construction
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <vector>

typedef unsigned int uint;

uint const N = 135;

template <typename T>
inline T &read(T &x) {
  x = 0;
  bool f = false;
  short ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = true;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + (ch ^ '0'), ch = getchar();
  if (f) x = -x;
  return x;
}

uint n, p, q, ans[N], Ans;

uint gcd(uint a, uint b) { return b ? gcd(b, a % b) : a; }

inline uint calc(uint j) {
  std::vector<uint> a, b;
  for (uint i = 1; i <= j; i++) a.push_back(n + 1 - i), b.push_back(i);
  for (uint &x : a)
    for (uint &y : b) {
      uint d = gcd(x, y);
      x /= d, y /= d;
    }
  uint ans = 1;
  for (uint x : a) ans *= x;
  return ans;
}

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("CF643F Bears and Juice.in", "r", stdin);
  freopen("CF643F Bears and Juice.out", "w", stdout);
#endif
#endif

  read(n), p = std::min(n - 1, read(p)), read(q);
  for (uint i = 0; i <= p; ++i) ans[i] = calc(i);
  for (uint i = 1; i <= q; ++i) {
    uint tmp = 0;
    for (uint j = 0, k = 1; j <= p; j++, k *= i) tmp += ans[j] * k;
    Ans ^= tmp * i;
  }
  printf("%u", Ans);
  return 0;
}